home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / mtex / documentation / mdocverb.tex < prev    next >
Encoding:
Text File  |  1991-04-26  |  1.2 KB  |  41 lines

  1. % macros for verbatim scanning
  2. % im wesentlichen dem file MANHDR TEX von DEK entnommen
  3. \catcode`@=11
  4. \def\tt{\fam\ttfam\tentt}%
  5. \newskip\ttglue  \ttglue=.5em plus .25em minus .15em
  6. \chardef\other=12
  7. \def\ttverbatim{\begingroup
  8.   \catcode`\\=\other
  9.   \catcode`\{=\other
  10.   \catcode`\}=\other
  11.   \catcode`\$=\other
  12.   \catcode`\&=\other
  13.   \catcode`\#=\other
  14.   \catcode`\%=\other
  15.   \catcode`\~=\other
  16.   \catcode`\_=\other
  17.   \catcode`\^=\other
  18.   \catcode`\"=\other
  19.   \parskip \z@
  20.   \obeyspaces \obeylines \tt}
  21.  
  22. \def\begintt{$$\let\par=\endgraf \ttverbatim
  23.   \catcode`\|=0 \rightskip-5pc \ttfinish}
  24. {\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
  25.   |obeylines % end of line is active
  26.   |gdef|ttfinish#1^^M#2\endtt{|vbox{#2}|endgroup$$}}
  27.  
  28. \catcode`\|=\active
  29. {\obeylines \gdef|{\ttverbatim \spaceskip\ttglue \let^^M=\  \let|=\endgroup}}
  30. %\def\ttspace{{\tt\hskip\ttglue}}
  31.  
  32. \def\vrt{\hbox{\tt\char`\|}} % vertical line
  33. \def\dn{\hbox{\tt\char'14}} % downward arrow
  34. \def\up{\hbox{\tt\char'13}} % upward arrow
  35. \def\]{\hbox{\tt\char`\ }} % visible space
  36.  
  37. \catcode`@=12 % at signs are no longer letters
  38. \def\verbatimon{\catcode`\|=\active}
  39. \def\verbatimoff{\catcode`\|=\other}
  40. \verbatimoff
  41.